/*     */ package com.newcrm.config;
/*     */ 
/*     */ import com.newcrm.bean.ProductInfo;
/*     */ import java.util.HashMap;
/*     */ import java.util.Map;
/*     */ import org.apache.commons.configuration.ConfigurationException;
/*     */ import org.apache.commons.configuration.XMLConfiguration;
/*     */ import org.apache.log4j.Logger;
/*     */ 
/*     */ public class Config
/*     */ {
/*  13 */   private static Logger logger = Logger.getLogger(Config.class.getName());
/*     */   private static final String CONFIG_FILE = "config.xml";
/*  16 */   private static Config config = null;
/*     */   private static final String PRODUCT_QIKEBAO = "product_qikebao.xml";
/*  20 */   public String dbDriverClass = null;
/*  21 */   public String dbJdbcUrl = null;
/*  22 */   public String user = null;
/*  23 */   public String pwd = null;
/*     */ 
/*  25 */   public Map<String, String> industryMap = new HashMap();
/*  26 */   public Map<String, String> phaseMap = new HashMap();
/*  27 */   public Map<String, String> statusMap = new HashMap();
/*  28 */   public Map<String, String> sexMap = new HashMap();
/*  29 */   public Map<String, String> importanceMap = new HashMap();
/*     */ 
/*  31 */   public String tableIdx = "";
/*     */ 
/*  33 */   public String taskCategory = "";
/*     */ 
/*  35 */   public String companyCustomerField = "";
/*  36 */   public String peopleCustomerField = "";
/*     */ 
/*  38 */   public String customerCategory = "";
/*     */ 
/*  40 */   public String[] phoneType = null;
/*  41 */   public String[] emailType = null;
/*  42 */   public String[] imType = null;
/*  43 */   public String[] weiboType = null;
/*  44 */   public String[] websiteType = null;
/*  45 */   public String[] addressType = null;
/*  46 */   public String[] noteDefaultWord = null;
/*     */ 
/*  59 */   public String filters = "stat";
/*     */ 
/*  62 */   public int initialSize = 1;
/*  63 */   public int minIdle = 1;
/*  64 */   public int maxActive = 20;
/*     */ 
/*  67 */   public long maxWait = 60000L;
/*     */ 
/*  70 */   public long timeBetweenEvictionRunsMillis = 60000L;
/*     */ 
/*  73 */   public long minEvictableIdleTimeMillis = 300000L;
/*     */ 
/*  75 */   public String validationQuery = "SELECT 'x'";
/*     */ 
/*  77 */   public boolean testWhileIdle = true;
/*  78 */   public boolean testOnBorrow = false;
/*  79 */   public boolean testOnReturn = false;
/*     */ 
/*  82 */   public boolean poolPreparedStatements = false;
/*  83 */   public int maxOpenPreparedStatements = 20;
/*     */ 
/*  85 */   public ProductInfo productInfo = new ProductInfo();
/*     */ 
/*     */   private Config() {
/*     */     try {
/*  89 */       XMLConfiguration xmlConfig = new XMLConfiguration("config.xml");
/*     */ 
/*  91 */       this.dbDriverClass = xmlConfig.getString("DB.driverClass");
/*  92 */       this.dbJdbcUrl = xmlConfig.getString("DB.jdbcUrl");
/*  93 */       this.user = xmlConfig.getString("DB.user");
/*  94 */       this.pwd = xmlConfig.getString("DB.pwd");
/*  95 */       this.tableIdx = xmlConfig.getString("DB.tableIdx");
/*     */ 
/*  97 */       this.taskCategory = xmlConfig.getString("init.taskCategory");
/*  98 */       this.companyCustomerField = xmlConfig
/*  99 */         .getString("init.customerField.company");
/* 100 */       this.peopleCustomerField = xmlConfig
/* 101 */         .getString("init.customerField.people");
/*     */ 
/* 103 */       this.customerCategory = xmlConfig
/* 104 */         .getString("init.customerCategory");
/*     */ 
/* 106 */       this.phoneType = xmlConfig.getString("init.phoneType").split(",");
/* 107 */       this.emailType = xmlConfig.getString("init.emailType").split(",");
/* 108 */       this.imType = xmlConfig.getString("init.imType").split(",");
/* 109 */       this.weiboType = xmlConfig.getString("init.weiboType").split(",");
/* 110 */       this.websiteType = xmlConfig.getString("init.websiteType").split(
/* 111 */         ",");
/* 112 */       this.addressType = xmlConfig.getString("init.addressType").split(
/* 113 */         ",");
/* 114 */       this.noteDefaultWord = xmlConfig.getString("init.noteDefaultWord")
/* 115 */         .split(",");
/*     */ 
/* 118 */       this.filters = xmlConfig.getString("druid.filters");
/*     */ 
/* 120 */       this.initialSize = xmlConfig.getInt("druid.initialSize", 1);
/* 121 */       this.minIdle = xmlConfig.getInt("druid.minIdle", 1);
/* 122 */       this.maxActive = xmlConfig.getInt("druid.maxActive", 20);
/*     */ 
/* 124 */       this.maxWait = xmlConfig.getLong("druid.maxWait", 60000L);
/* 125 */       this.timeBetweenEvictionRunsMillis = xmlConfig.getLong(
/* 126 */         "druid.timeBetweenEvictionRunsMillis", 60000L);
/* 127 */       this.minEvictableIdleTimeMillis = xmlConfig.getLong(
/* 128 */         "druid.minEvictableIdleTimeMillis", 300000L);
/*     */ 
/* 130 */       this.validationQuery = xmlConfig.getString("druid.validationQuery");
/*     */ 
/* 132 */       this.testWhileIdle = xmlConfig.getBoolean("druid.testWhileIdle", 
/* 133 */         true);
/* 134 */       this.testOnBorrow = xmlConfig.getBoolean("druid.testOnBorrow", 
/* 135 */         false);
/* 136 */       this.testOnReturn = xmlConfig.getBoolean("druid.testOnReturn", 
/* 137 */         false);
/*     */ 
/* 139 */       this.poolPreparedStatements = xmlConfig.getBoolean(
/* 140 */         "druid.poolPreparedStatements", false);
/*     */ 
/* 142 */       this.maxOpenPreparedStatements = xmlConfig.getInt(
/* 143 */         "druid.maxOpenPreparedStatements", 20);
/*     */ 
/* 147 */       String productFileName = xmlConfig
/* 148 */         .getString("init.productFileName");
/* 149 */       if ((productFileName == null) || (productFileName.trim().length() == 0)) {
/* 150 */         productFileName = "product_qikebao.xml";
/*     */       }
/*     */ 
/* 153 */       XMLConfiguration productFileConfig = new XMLConfiguration(
/* 154 */         productFileName);
/*     */ 
/* 156 */       this.productInfo.productName = productFileConfig
/* 157 */         .getString("init.productName");
/* 158 */       this.productInfo.productId = productFileConfig
/* 159 */         .getString("init.productId");
/* 160 */       this.productInfo.logoImageExtInfo = productFileConfig
/* 161 */         .getString("init.logoImageExtInfo");
/* 162 */       this.productInfo.setupFile = productFileConfig
/* 163 */         .getString("init.setupFile");
/* 164 */       this.productInfo.helpFile = productFileConfig
/* 165 */         .getString("init.helpFile");
/* 166 */       this.productInfo.companyName = productFileConfig
/* 167 */         .getString("init.companyName");
/* 168 */       this.productInfo.companyTel = productFileConfig
/* 169 */         .getString("init.companyTel");
/* 170 */       this.productInfo.companyAddress = productFileConfig
/* 171 */         .getString("init.companyAddress");
/* 172 */       this.productInfo.companyHref = productFileConfig
/* 173 */         .getString("init.companyHref");
/* 174 */       this.productInfo.customerService = productFileConfig
/* 175 */         .getString("init.customerService");
/* 176 */       this.productInfo.complainService = productFileConfig
/* 177 */         .getString("init.complainService");
/* 178 */       this.productInfo.activeCodeFlag = productFileConfig
/* 179 */         .getString("init.activeCodeFlag");
/* 180 */       this.productInfo.accessIDServer = productFileConfig
/* 181 */         .getString("server.accessIDServer");
/*     */     }
/*     */     catch (ConfigurationException e) {
/* 184 */       logger.warn("load config file failed", e);
/*     */     }
/*     */   }
/*     */ 
/*     */   public static Config getInstance() {
/* 189 */     if (config == null) {
/* 190 */       config = new Config();
/*     */     }
/* 192 */     return config;
/*     */   }
/*     */ }

/* Location:           C:\E\referenceProject\CRM参考\qikebao\WEB-INF\lib\qikebao.jar
 * Qualified Name:     com.newcrm.config.Config
 * JD-Core Version:    0.6.1
 */